package io.gitee.sfch.chunmi.code.generator.filter;


import io.gitee.sfch.chunmi.code.generator.entity.ColumnRef;

import java.util.function.Predicate;

/**
 * 增加删改实体中定义的字段过滤
 */
public class CurdEntityColumnRefFilter implements Predicate<ColumnRef> {

    private final String[] superClassFields = {"id", "createTime", "creatorId", "updateTime", "updaterId"};

    @Override
    public boolean test(ColumnRef columnRef) {
        for (String superClassField : superClassFields) {
            if (superClassField.equals(columnRef.getCameCaseName())) {
                return false;
            }
        }
        return true;
    }
}
